Repository navigation
fix(id): make collab Steps acceptance atomic (#2968) - #3683
Conversation
Hold the steps write lock across the version check, append, and version bump by extracting acceptance into Document::try_apply_steps. Two sockets submitting at the same base version can no longer both pass the check and silently diverge: exactly one is Acked, the other gets the existing Version mismatch error. Broadcast and Ack stay in the handler, after the lock is released. Regression tests: barrier-synchronised concurrent same-base submissions (exactly one winner; stored state reflects only the winner) and the sequential stale-base rejection flow.
Replace the barrier-burst concurrent test (which passed even under the pre-fix ordering: the check-to-bump window closes before woken tasks interleave) with a contention-gated one: submitters park on the held steps write lock, modelling the production window where lock contention sits between a socket's check and its append. Verified failing-first: under the pre-fix ordering the gated test fails with a second submitter wrongly accepted (Ok(2)); under the fixed ordering exactly one submitter wins, deterministically.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 42 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Local verification completed on the merged-main worktree: |
…89-2968-steps-atomic # Conflicts: # pkgs/id/src/web/collab.rs
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Merged as ddd7dd6 after resolving the main conflict. |
Summary
Fixes #2968
Verification
git diff --check origin/main...HEAD— passcargo test --features web collab::— running locally; result will be added after completion.Need help on this PR? Tag
@codesmith-botwith what you need.